#Include <ScreenCapture.au3>
#Include <File.au3>
#Include <GuiListView.au3>
#Include <Date.au3>
#include <Comon For Document Pallet.au3>

Common_WriteCurrentFunctionNameToTempTXT($sDocumentPalletFunctionName)

DocumentPallet1_1_2()
DocumentPallet1_1_4()
DocumentPallet1_1_6()
If Not $bPageViewType Then   ;No document pallet view in page viewer.
	DocumentPallet1_1_7()
	DocumentPallet1_1_8()
EndIf
DocumentPallet2_1_1()
DocumentPallet2_1_2()
DocumentPallet2_1_3()
DocumentPallet2_1_4()
DocumentPallet2_1_5()
DocumentPallet3_1_2()
DocumentPallet3_1_3()
DocumentPallet3_1_4()
DocumentPallet3_1_10()
DocumentPallet3_1_12()
DocumentPallet3_1_13()
DocumentPallet3_1_15() 
DocumentPallet3_1_16()
DocumentPallet3_1_20()
DocumentPallet3_1_26()
DocumentPallet3_1_31()
DocumentPallet3_1_32()
DocumentPallet3_1_37()
DocumentPallet3_1_39() 
DocumentPallet3_1_44()
DocumentPallet3_1_45()
DocumentPallet3_1_46()
DocumentPallet3_1_47()
DocumentPallet3_1_48()
CloseOpenedExcel($oExcel)
Func DocumentPallet1_1_2()
	Local $TestCaseID = "1.1.2"   ; The test case number of Thumbnail View STD.
	$sCusMsg = 'The image is Document Pallet window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	OpenDocumentPallet($hPMHandle)
	Common_SleepTime(1)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  	
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc   

Func DocumentPallet1_1_4()
	Local $TestCaseID = "1.1.4"   ; The test case number of Thumbnail View STD.
		$sCusMsg = 'The image is Document Pallet window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	ControlClick($hPMHandle, "", $sSwicthToListViewButtonCtrInfo)   ; Switch to list view.
	Common_SleepTime(3)
	OpenDocumentPallet($hPMHandle)
	Common_SleepTime(1)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc   

Func DocumentPallet1_1_6()
	Local $TestCaseID = "1.1.6"   ; The test case number of Thumbnail View STD.
		$sCusMsg = 'The image is Document Pallet window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	ControlClick($hPMHandle, "", $sSwicthToTitleViewButtonInCtrInfo)   ; Switch to title view.
	Common_SleepTime(3)
	OpenDocumentPallet($hPMHandle)
	Common_SleepTime(1)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	Common_SleepTime(2) 
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc   

Func DocumentPallet1_1_7()
	Local $TestCaseID = "1.1.7"   ; The test case number of Thumbnail View STD.
		$sCusMsg = 'The image show document pallet, it cannot opend'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlClick($hPMHandle, "", $sPageViewButtonInToolbarCtrInfo)   ; Switch to page view.
	Common_SleepTime(8)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletStatusBar)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc  

Func DocumentPallet1_1_8()
	Local $TestCaseID = "1.1.8"   ; The test case number of Thumbnail View STD.
		$sCusMsg = 'The image show document pallet, it cannot opend'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView,0)
	Common_SleepTime(1)
	ControlClick($hPMHandle, "", $sOCRButtonInToolbarCtrInfo)   ; Switch to OCR view.
	Common_SleepTime(26)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletStatusBar)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	Common_SleepTime(2) 
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc  

Func DocumentPallet2_1_1()
	Local $TestCaseID = "2.1.1"   ; The test case number of Thumbnail View STD.
		$sCusMsg = '3 files should in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sDocumentPalletListView)
	OpenDocumentPallet($hPMHandle)
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $sThumbnailViewCtrInfo,"Select", 0 ,2)
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc  

Func DocumentPallet2_1_2()
	Local $TestCaseID = "2.1.2"   ; The test case number of Thumbnail View STD.
		$sCusMsg = 'Stack file should in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView,0)
	ControlListView($hPMHandle, "", $sThumbnailViewCtrInfo,"Select", 0 ,2)
	Common_SleepTime(2)
	ControlClick($hPMHandle, "", $sStackButtonInToolbarCtrInfo)   ; Stack files.
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc  

Func DocumentPallet2_1_3()
	Local $TestCaseID = "2.1.3"   ; The test case number of Thumbnail View STD.
		$sCusMsg = 'One file shoul in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	FileCopy($COMMON_SAMPLES_FOLDER_PATH & 'Multi_PAGE.tif', $PMFolder, 1)
	Sleep(500)
	Send('{F5}')
	Sleep(500)
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)	
	MouseClickDrag('left',261, 167,698, 879)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc  

Func DocumentPallet2_1_4()
	Local $TestCaseID = "2.1.4"   ; The test case number of Thumbnail View STD.
		$sCusMsg = '4 files should in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	ControlClick($hPMHandle, "", $sSwicthToListViewButtonCtrInfo)   ; Switch to list view.
	Common_SleepTime(1)
	OpenDocumentPallet($hPMHandle)
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,3 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(263, 119)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc 

Func DocumentPallet2_1_5()
	Local $TestCaseID = "2.1.5"   ; The test case number of Thumbnail View STD.
		$sCusMsg = '4 files should in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	ControlClick($hPMHandle, "", $sSwicthToTitleViewButtonInCtrInfo)   ; Switch to title view.
	Common_SleepTime(1)
	OpenDocumentPallet($hPMHandle)
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,3 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(263, 119)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc 

Func DocumentPallet3_1_2()
	Local $TestCaseID = "3.1.2"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	OpenDocumentPallet($hPMHandle)
	Common_SleepTime(1)
	DocumentSettings($hPMHandle)  
	Common_SleepTime(2)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingCancel)   ; Click cancel button.
	Common_SleepTime(1)
	If WinExists($tDocumentPallet, "") Then
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	Else
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1  
	EndIf
EndFunc   

Func DocumentPallet3_1_3()
	Local $TestCaseID = "3.1.3"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0)  
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,3 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)  ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingBrowse)
	Common_SleepTime(1)
	SendFolder($sMyPageManagerSampleFolder)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	Sendfiles($hPMHandle)   ; send files in document pallet.
	Common_SleepTime(6)
	If FileExists($sPMFolderPath & $FileName_1) And FileExists($sPMFolderPath & $FileName_2) And FileExists($sPMFolderPath & $FileName_3) And FileExists($sPMFolderPath & $FileName_4) Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 
	ElseIf FileExists($sPMFolderPath & 'Copy of BMP_16Bit.bmp') And FileExists($sPMFolderPath & 'Copy of BW_100DPI.TIF') And FileExists($sPMFolderPath & 'Copy of JPEG_Color.jpg') And FileExists($sPMFolderPath & 'Copy of TIFF_8Bit.tif') Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1
		
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_4()
	Local $TestCaseID = "3.1.4"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,3 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)  ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingBrowse)
	Common_SleepTime(1)
	SendFolder($sMyPageManagerSampleFolder)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)   
	Common_SleepTime(1)
	Send("^a")
	Common_SleepTime(1)
	MouseClick("right", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	Send("{DOWN}")
	Common_SleepTime(1)
	Send("{ENTER}")
	Common_SleepTime(6)
	If FileExists($sPMFolderPath & $FileName_1) And FileExists($sPMFolderPath & $FileName_2) And FileExists($sPMFolderPath & $FileName_3) And FileExists($sPMFolderPath & $FileName_4) Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1
	ElseIf FileExists($sPMFolderPath & 'Copy of BMP_16Bit.bmp') And FileExists($sPMFolderPath & 'Copy of BW_100DPI.TIF') And FileExists($sPMFolderPath & 'Copy of JPEG_Color.jpg') And FileExists($sPMFolderPath & 'Copy of TIFF_8Bit.tif') Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_10()
	Local $TestCaseID = "3.1.10"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	FileDelete(@WindowsDir & "\" & $FileName_1)
	FileDelete(@WindowsDir & "\" & $FileName_2)
	FileDelete(@WindowsDir & "\" & $FileName_3)
	FileDelete(@WindowsDir & "\" & $FileName_4)
	FileDelete(@WindowsDir & "\" & 'Copy of Bird.TIF')
	FileDelete(@WindowsDir & "\" & 'Copy of BizCard 6.pdf')
	FileDelete(@WindowsDir & "\" & 'Copy of BizCard Xpress.pdf')
	FileDelete(@WindowsDir & "\" & 'Copy of Building.jpg')
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,3 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)   ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingBrowse)
	Common_SleepTime(1)
	Local $title = "Browse For Folder"
	ControlTreeView($title, "", "SysTreeView321","Expand","#0|#2")
	Sleep(500)
	ControlTreeView($title, "", "SysTreeView321","Expand","#0|#2|#0")
	Sleep(500)
	Local $TreeViewHandle = ControlGetHandle($title, "", "SysTreeView321")
	Local $Item = _GUICtrlTreeView_FindItem($TreeViewHandle, "WINDOWS")
	Sleep(500)
	_GUICtrlTreeView_SelectItem($TreeViewHandle,$Item);Select
	Sleep(300)
	ControlClick($title, "", 1)
	Sleep(300)	
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	Send("^a")
	Common_SleepTime(1)
	MouseClick("right", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)   
	Common_SleepTime(1)
	Send("{DOWN}")
	Common_SleepTime(1)
	Send("{ENTER}")
	Common_SleepTime(6)
	If FileExists("C:\WINDOWS\" & $FileName_1) And FileExists("C:\WINDOWS\" & $FileName_2) And FileExists("C:\WINDOWS\" & $FileName_3) And FileExists("C:\WINDOWS\" & $FileName_4) Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		FileDelete(@WindowsDir & "\" & $FileName_1)
		FileDelete(@WindowsDir & "\" & $FileName_2)
		FileDelete(@WindowsDir & "\" & $FileName_3)
		FileDelete(@WindowsDir & "\" & $FileName_4)
		Return 1
	ElseIf FileExists("C:\WINDOWS\" & 'Copy of Bird.TIF') And FileExists("C:\WINDOWS\" & 'Copy of BizCard 6.pdf') And FileExists("C:\WINDOWS\" & 'Copy of BizCard Xpress.pdf') And FileExists("C:\WINDOWS\" & 'Copy of Building.jpg') Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
	FileDelete(@WindowsDir & "\" & 'Copy of Bird.TIF')
	FileDelete(@WindowsDir & "\" & 'Copy of BizCard 6.pdf')
	FileDelete(@WindowsDir & "\" & 'Copy of BizCard Xpress.pdf')
	FileDelete(@WindowsDir & "\" & 'Copy of Building.jpg')
		Return 1
		
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_12()
	Local $TestCaseID = "3.1.12"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	DirCreate("C:\0Test")
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,3 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)   ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingBrowse)
	Common_SleepTime(1)
	Local $title = "Browse For Folder"
	ControlTreeView($title, "", "SysTreeView321","Collapse","#0|#2")
	Sleep(500)
	ControlTreeView($title, "", "SysTreeView321","Expand","#0|#2")
	Sleep(500)
	ControlTreeView($title, "", "SysTreeView321","Expand","#0|#2|#0")
	Sleep(500)
	Local $TreeViewHandle = ControlGetHandle($title, "", "SysTreeView321")
	Local $Item = _GUICtrlTreeView_FindItem($TreeViewHandle, "0Test")
	Sleep(500)
	_GUICtrlTreeView_ClickItem($TreeViewHandle,$Item)
	_GUICtrlTreeView_SelectItem($TreeViewHandle,$Item)
	Sleep(300)	
	ControlClick($title, "", 1)
	Sleep(300)	
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	Send("^a")
	Common_SleepTime(1)
	Sendfiles($hPMHandle)   ; send files in document pallet.
	Common_SleepTime(6)
	If FileExists("C:\0Test\" & $FileName_1) And FileExists("C:\0Test\" & $FileName_2) And FileExists("C:\0Test\" & $FileName_3) And FileExists("C:\0Test\" & $FileName_4) Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		DirRemove("C:\0Test", 1)
		Return 1
	ElseIf FileExists("C:\0Test\" & 'AutumnView.jpg') And FileExists("C:\0Test\" & 'BizCard 6.pdf') And FileExists("C:\0Test\" & 'Building.psd') And FileExists("C:\0Test\" & 'Car Alarm.wav') Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		DirRemove("C:\0Test", 1)
	ElseIf FileExists("C:\0Test\" & 'Bird.TIF') And FileExists("C:\0Test\" & 'BizCard 6.pdf') And FileExists("C:\0Test\" & 'BizCard Xpress.pdf') And FileExists("C:\0Test\" & 'Building.jpg') Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		DirRemove("C:\0Test", 1)
	ElseIf FileExists("C:\0Test\" & 'Copy of Bird.TIF') And FileExists("C:\0Test\" & 'Copy of BizCard 6.pdf') And FileExists("C:\0Test\" & 'Copy of BizCard Xpress.pdf') And FileExists("C:\0Test\" & 'Copy of Building.jpg') Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		DirRemove("C:\0Test", 1)
	Else
		Common_WriteLog($sFaile &$sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		DirRemove("C:\0Test", 1)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_13()
	Local $TestCaseID = "3.1.13"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)   ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingBrowse)
	Common_SleepTime(1)
	SendFolder($sMyPageManagerSampleFolder)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	Sendfiles($hPMHandle)   ; send files in document pallet.
	Common_SleepTime(6)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	SendFolder($sMyPageManagerSampleFolder)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	Send("^a")
	Common_SleepTime(1)
	Sendfiles($hPMHandle)   ; send files in document pallet.
	Common_SleepTime(6)	
	If FileExists($sPMFolderPath & $FileName_1) And FileExists($sPMFolderPath & "Copy of AutumnView(1).jpg") Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1
	ElseIf FileExists($sPMFolderPath & $FileName_1) And FileExists($sPMFolderPath & "Copy of Copy of AutumnView.jpg") Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1
	ElseIf FileExists($sPMFolderPath & 'Bird.TIF') And FileExists($sPMFolderPath & "Copy of Copy of Bird.TIF") Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1
	ElseIf FileExists($sPMFolderPath & 'Copy of Copy of BMP_16Bit.bmp') Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1		
	Else
		Common_WriteLog($sFaile &$sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)   
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_15()
	Local $TestCaseID = "3.1.15"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	DirCreate(@MyDocumentsDir & "\My PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PdaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy y PaaMy PaaMy PaaMy")
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,3 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)   ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingBrowse)
	Common_SleepTime(1)
	Local $title = "Browse For Folder"
	ControlTreeView($title, "", "SysTreeView321","Expand","#0|#1|#2")
	Sleep(500)
	Local $TreeViewHandle = ControlGetHandle($title, "", "SysTreeView321")
	Local $Item = _GUICtrlTreeView_FindItem($TreeViewHandle, $sDocuments)
	If $Item == 0 Then $Item = _GUICtrlTreeView_FindItem($TreeViewHandle, $sMyDocuments)
	If $Item == 0 Then $Item = _GUICtrlTreeView_FindItem($TreeViewHandle, 'Documents')	
	If $Item == 0 Then $Item = _GUICtrlTreeView_FindItem($TreeViewHandle, 'My Documents')
	Sleep(500)
	_GUICtrlTreeView_ClickItem($TreeViewHandle, $Item)
	_GUICtrlTreeView_SelectItem($TreeViewHandle, $Item)
	Sleep(300)
	$Item = _GUICtrlTreeView_FindItem($TreeViewHandle, $sMyPageManagerSampleFolder)
	Sleep(500)
	_GUICtrlTreeView_ClickItem($TreeViewHandle, $Item)
	_GUICtrlTreeView_SelectItem($TreeViewHandle, $Item)
	Sleep(300)	
	Send("{up}")
	Sleep(300)	
	ControlClick($title, "", 1)
	Sleep(300)	
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	Sendfiles($hPMHandle)   ; send files in document pallet.
	Common_SleepTime(6)
	Local $text = ControlGetText("Presto! PageManager", "", 65535)
	If $text = "This path is too long. Can't take any action on the file." Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		DirRemove(@MyDocumentsDir & "\My PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PdaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy",1)
		Send("{ESC}")
		Return 1
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		DirRemove(@MyDocumentsDir & "\My PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PdaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy PaaMy",1)
		Send("{ESC}")
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_16()
	Local $TestCaseID = "3.1.16"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	FileDelete("C:\" & $FileName_1)
	FileDelete("C:\" & $FileName_2)
	FileDelete("C:\" & $FileName_3)
	FileDelete("C:\" & $FileName_4)
	FileDelete("C:\" & 'Copy of Bird.TIF')
	FileDelete("C:\" & 'Copy of BizCard 6.pdf')
	FileDelete("C:\" & 'Copy of BizCard Xpress.pdf')
	FileDelete("C:\" & 'Copy of Building.jpg')
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,3 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)   ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingBrowse)
	Common_SleepTime(1)
	Local $title = "Browse For Folder"
	ControlTreeView($title, "", "SysTreeView321","Expand","#0|#2")
	Sleep(500)
	Local $TreeViewHandle = ControlGetHandle($title, "", "SysTreeView321")
	Local $Item = _GUICtrlTreeView_FindItem($TreeViewHandle, "Computer")
	Sleep(500)
	_GUICtrlTreeView_ClickItem($TreeViewHandle, $Item)
	_GUICtrlTreeView_SelectItem($TreeViewHandle, $Item)
	Sleep(300)	
	Send("{down}")
	Sleep(1000)
	ControlClick($title, "", 1)
	Sleep(300)	
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	Send("^a")
	Common_SleepTime(1)
	Sendfiles($hPMHandle)   ; send files in document pallet.
	Common_SleepTime(6)
	If FileExists("C:\" & $FileName_1) And FileExists("C:\" & $FileName_2) And FileExists("C:\" & $FileName_3) And FileExists("C:\" & $FileName_4) Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		FileDelete("C:\" & $FileName_1)
		FileDelete("C:\" & $FileName_2)
		FileDelete("C:\" & $FileName_3)
		FileDelete("C:\" & $FileName_4)
		Return 1
	ElseIf FileExists("C:\" & 'Copy of Bird.TIF') And FileExists("C:\" & 'Copy of BizCard 6.pdf') And FileExists("C:\" & 'Copy of BizCard Xpress.pdf') And FileExists("C:\" & 'Copy of Building.jpg') Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		FileDelete("C:\" & 'Copy of Bird.TIF')
		FileDelete("C:\" & 'Copy of BizCard 6.pdf')
		FileDelete("C:\" & 'Copy of BizCard Xpress.pdf')
		FileDelete("C:\" & 'Copy of Building.jpg')
		Return 1
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
	
EndFunc 

Func DocumentPallet3_1_20()
	Local $TestCaseID = "3.1.20"   ; The test case number of Thumbnail View STD.
		$sCusMsg = '4 fiels in image'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,3 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)   ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSendByMail)
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletOutlook)
	Common_SleepTime(1)
	Send("m")
	Common_SleepTime(1)
	Send("{ENTER}")
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(2)
	Sendfiles($hPMHandle)   ; send files in document pallet.
	Common_SleepTime(30)
;	CloseOutlookActivationDialog()
	$PrHandle=ControlGetHandle($sOutLookTitle,"",4104)
	Common_SleepTime(4) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $PrHandle)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		ProcessClose("OUTLOOK.exe")		
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		ProcessClose("OUTLOOK.exe")
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_26()
	Local $TestCaseID = "3.1.26"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameDocumentPallet)
	SwitchToSampleFolder($hPMHandle)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	Common_SleepTime(4) 
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,1 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)   ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingBrowse)
	Common_SleepTime(1)
	SendFolder($sMyPageManagerSampleFolder)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingConvert)   ; Convert to PDF.
	Sleep(300)	
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	MouseClick("right", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)   
	Common_SleepTime(1)
	Send("{DOWN}")
	Common_SleepTime(1)
	Send("{ENTER}")
	Common_SleepTime(4)
	$CaptureCompareResult = FileExists($PMFolder & 'Copy of 01.wav')   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_28()
	Local $TestCaseID = "3.1.28"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	If $sPMVersion = "SE" Then
		Return 0
	EndIf
	Local $sCaptureImage = $TestCaseID & '.jpg'
	Common_Del_DB()   ; Delete PM DB.
	FileCopy($SamplePatch & "1.exe", @MyDocumentsDir & "\My PageManager\", 1) 
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)   ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", 7018)   ; Convert to PDF.
	Sleep(300)	
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	Send("^a")
	Common_SleepTime(1)
	MouseClick("right", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)   
	Common_SleepTime(1)
	Send("{DOWN}")
	Common_SleepTime(1)
	Send("{ENTER}")
	Common_SleepTime(4)
	If WinExists($sAllMessageTitle , 'OK') Then
		Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sAllMessageTitle)
		Send("{enter}")
		Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
		If $CaptureCompareResult Then			
			Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)   
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0
		EndIf
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_30()
	Local $TestCaseID = "3.1.30"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	;FileCopy($sFilePatch & "1.exe", @MyDocumentsDir & "\My PageManager\", 1) 
	;FileDelete(@MyDocumentsDir & "\1001.pdf")
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameDocumentPallet)
	SwitchToSampleFolder($hPMHandle)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	Common_SleepTime(4) 
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,1 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)   ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingBrowse)
	Common_SleepTime(1)
	SendFolder($sMyPageManagerSampleFolder)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingConvert)   ; Convert to PDF.
	Sleep(300)	
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(1)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-25)
	Common_SleepTime(2)
	Send("^a")
	Common_SleepTime(2)
	MouseClick("right", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-25)   
	Common_SleepTime(2)
	Send("{DOWN}")
	Common_SleepTime(2)
	Send("{ENTER}")
	Common_SleepTime(10)
	If FileExists($sPMFolderPath & "My PageManager02001.pdf")Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 
	ElseIf FileExists($sPMFolderPath & "01001.pdf")Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	Endif
EndFunc 

Func DocumentPallet3_1_31()
	Local $TestCaseID = "3.1.31"   ; The test case number of Thumbnail View STD.
		$sCusMsg = '2 files in image'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameDocumentPallet)
	SwitchToSampleFolder($hPMHandle)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	Common_SleepTime(4) 
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,3 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	DocumentSettings($hPMHandle)   ; Document settings.
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSendByMail)
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletOutlook)
	Common_SleepTime(1)
	Send("m")
	Common_SleepTime(1)
	Send("{ENTER}")
	Common_SleepTime(1)
	ControlClick($tDocumentPallet, "", $sDocumentPalletSettingOK)
	Common_SleepTime(2)
	Sendfiles($hPMHandle)   ; send files in document pallet.
	Common_SleepTime(10)
	If WinExists('Convert information', 'OK' )Then
		WinWaitActive('Convert information', 'OK')
		Send('{ENTER}')
	EndIf
	Common_SleepTime(10)
	$PrHandle=ControlGetHandle($sOutLookTitle,"",4104)
	Common_SleepTime(4) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $PrHandle)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		ProcessClose("OUTLOOK.exe")		
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		ProcessClose("OUTLOOK.exe")
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_32()
	Local $TestCaseID = "3.1.32"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameDocumentPallet)
	SwitchToSampleFolder($hPMHandle)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	Common_SleepTime(4) 
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,1 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	MouseClick("right", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)   
	Common_SleepTime(1)
	Send("p")
	Common_SleepTime(1)
	Send("{ENTER}")
	Common_SleepTime(8)
	$PrHandle=WinGetHandle("Presto! PageManager")
	Common_SleepTime(4) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $PrHandle)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_33()
	Local $TestCaseID = "3.1.33"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	If $sPMVersion = "SE" Then
		Return 0
	EndIf
	Local $sCaptureImage = $TestCaseID & '.jpg'
	Common_Del_DB()   ; Delete PM DB.
	FileCopy($SamplePatch & "1.exe", @MyDocumentsDir & "\My PageManager\", 1) 
	FileDelete(@MyDocumentsDir & "\1001.pdf")
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	Send("^a")
	Common_SleepTime(1)
	MouseClick("right", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)   
	Common_SleepTime(1)
	Send("p")
	Common_SleepTime(1)
	Send("{ENTER}")
	Common_SleepTime(4)
	If WinExists($sAllMessageTitle) Then
		Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sAllMessageTitle)
		Send("{enter}")
		Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
		If $CaptureCompareResult Then			
			Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0
		EndIf
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_37()
	Local $TestCaseID = "3.1.37"   ; The test case number of Thumbnail View STD.
		$sCusMsg = '4 files should in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,4 )
	Common_SleepTime(1)
	ControlClick($hPMHandle, "", $sStackButtonInToolbarCtrInfo)   ; Stack files.
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)	
	ControlClick($hPMHandle, "", $sUnstackButtonInToolbar)   ; Unstack files.	
	Common_SleepTime(2)
	MouseMove(261, 172)
	Common_SleepTime(2)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc  

Func DocumentPallet3_1_39()
	Local $TestCaseID = "3.1.39"   ; The test case number of Thumbnail View STD.
		$sCusMsg = '4 files should in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,4 )
	Common_SleepTime(3)
	MouseClick("left", 800,7);active PM
	Send("{ALTDOWN}")
	Send("T")
	Sleep(300)
    Send("S")
	Sleep(300)
	Send("{ALTUP}")
	Sleep(300)
	Send("{ENTER}")	; Stack files.
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	;MouseClick("left", 800,7);active PM
	Send("!t") 
	Sleep(300)
    Send("{DOWN}")
	Sleep(300)
	Send("{DOWN}")
	Sleep(300)
	Send("{RIGHT}")
	Sleep(300)
	Send("{ENTER}")	   ; Unstack files.	
	Common_SleepTime(2)
	MouseMove(261, 172)
	Common_SleepTime(2)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc  

Func DocumentPallet3_1_41()
	Local $TestCaseID = "3.1.41"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posTreeView = ControlGetPos($hPMHandle,"",$sTreeViewCtrInfo)
	MouseMove(124, 600)   ;pagemanager folder in Treeview
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posTreeView = ControlGetPos($hPMHandle,"",$sTreeViewCtrInfo)
	MouseMove(124, 600);pagemanager folder in Treeview
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(4)	
	If FileExists($sPMFolderPath & "AutumnView - Copy.jpg") And FileExists($sPMFolderPath & "AutumnView - Copy (2).jpg") Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 
	ElseIf FileExists($sPMFolderPath & "Bird - Copy.TIF") And FileExists($sPMFolderPath & "Bird - Copy (2).TIF") Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 		
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_42()
	Local $TestCaseID = "3.1.42"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,1 )
	Common_SleepTime(1)
	ControlClick($hPMHandle, "", $sStackButtonInToolbarCtrInfo)   ; Stack files.
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posTreeView = ControlGetPos($hPMHandle,"",$sTreeViewCtrInfo)
	MouseMove(124, 600);pagemanager folder in Treeview
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(4)	
	If FileExists($sPMFolderPath & "BizCard 6 - Copy.pdf") Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_43()
	Local $TestCaseID = "3.1.43"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 7) 
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(450, 300)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
		Local $posTreeView = ControlGetPos($hPMHandle,"",$sTreeViewCtrInfo)
	MouseMove(124, 600);pagemanager folder in Treeview
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(4)	
	If FileExists($sPMFolderPath & "Forms - Copy.pdf") Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 
	ElseIf FileExists($sPMFolderPath & "Coffee - Copy.png") Then
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_44()
	Local $TestCaseID = "3.1.44"   ; The test case number of Thumbnail View STD.
		$sCusMsg = '3 files should in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,4 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	MouseClick("right", 228, 868) 
	Common_SleepTime(1)
	Send("D")
	Common_SleepTime(2)	
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc  

Func DocumentPallet3_1_45()
	Local $TestCaseID = "3.1.45"   ; The test case number of Thumbnail View STD.
		$sCusMsg = '3 files should in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,4 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	MouseClick("left", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20)
	Common_SleepTime(1)
	;Send("^a")
	;Common_SleepTime(1)
	Send("{DEL}")
	Send("{ENTER}")
	Common_SleepTime(2)	
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc  

Func DocumentPallet3_1_46()
	Local $TestCaseID = "3.1.46"   ; The test case number of Thumbnail View STD.
		$sCusMsg = 'No files in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,4 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(1)
	MouseClick("right", $posDocumentPallet[0],$posDocumentPallet[1]+$posDocumentPallet[3]-20) 
	Common_SleepTime(1)
	Send("D")
	Common_SleepTime(2)	
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)   
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc  

Func DocumentPallet3_1_47()
	Local $TestCaseID = "3.1.47"   ; The test case number of Thumbnail View STD.
		$sCusMsg = 'No files in Document Pallet'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,4 )
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	ControlListView($hPMHandle, "", $hThumbnailView, "Select", 0,4 )
	Common_SleepTime(1)
	Send("{DEL}")
	Common_SleepTime(2)
	Send("{ENTER}")
	Common_SleepTime(3)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc 

Func DocumentPallet3_1_48()
	Local $TestCaseID = "3.1.48"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Oen document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	;WinActivate($PMTitle) 	
	Send("!f")
	Common_SleepTime(1)
	Send("e")
	Common_SleepTime(2)
	$PrHandle=WinGetHandle("Presto! PageManager")
	Common_SleepTime(4) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $PrHandle)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc 

Func DocumentPallet3_1_50()
	Local $TestCaseID = "3.1.50"   ; The test case number of Thumbnail View STD.
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sDocumentPalletFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sDocumentPalletFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForDocumentPallet()
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(1)
	_GUICtrlListView_ClickItem($hThumbnailView, 0) 
	Common_SleepTime(1)
	Send("{CTRLDOWN}")
	Common_SleepTime(1)
	MouseMove(261, 172)
	Common_SleepTime(1)
	MouseDown("left")
	Common_SleepTime(1)
	Local $posDocumentPallet = ControlGetPos($hPMHandle,"",$sDocumentPalletListView)
	MouseMove($posDocumentPallet[0]+$posDocumentPallet[2]/2,$posDocumentPallet[1]+$posDocumentPallet[3])
	Common_SleepTime(1)
	MouseUp("left")	
	Common_SleepTime(1)
	Send("{CTRLup}")
	Common_SleepTime(3)
	;WinActivate($PMTitle) 	
	Send("!f")
	Common_SleepTime(1)
	Send("e")
	Common_SleepTime(2)
	Send("{ENTER}")
	Sleep(1000)
	Common_Close_PM($hPMHandle) 
	Common_SleepTime(2)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	CopySamppleToPMFolder2()
	Local $hThumbnailView=ControlGetHandle($hPMHandle,"",$sThumbnailViewCtrInfo)
	OpenDocumentPallet($hPMHandle)   ; Open document pallet.
	Common_SleepTime(2)
	Local $hDocumentPallet = ControlGetHandle($hPMHandle, "", $sDocumentPalletListView)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $hDocumentPallet)
	$CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sDocumentPalletFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc 
